@extends('admin.layout.index')
@section('content')
	
	<div class="mws-panel grid_8">
    	<div class="mws-panel-header">
        	<span>添加分类</span>
        </div>
        <div class="mws-panel-body no-padding">
        	<form class="mws-form" action="/admin/cate/insert" method="post">
        		{{ csrf_field() }}
        		<div class="mws-form-inline">
        			<div class="mws-form-row">
        				<label class="mws-form-label">分类名称</label>
        				<div class="mws-form-item">
        					<input type="text" class="small" name="name" value="{{ old('name') }}" placeholder="请输入分类名称">
        				</div>
        			</div>
        			<div class="mws-form-row">
        				<label class="mws-form-label">所属分类</label>
        				<div class="mws-form-item">
        							<select name="pid" style='width:55%'>
										<option value="0">--请选择(不选择默认最大父类)--</option>
										@foreach($data as $k => $v)
										<option value="{{$v['id']}}" @if($id == $v['id']) selected @endif>{{$v['name']}}</option>
										@endforeach
								  </select>
						</div>
					</div>
        		<div class="mws-button-row">
        			<input type="submit" value="添加" class="btn btn-danger">
        			<input type="reset" value="重置" class="btn ">
        		</div>
        	</form>
        </div>    	
    </div>
@endsection